#ifndef __TIMER_H_
#define __TIMER_H_

#include <stdint.h>

typedef struct {
	void(*cb)(void);
	uint16_t period;
	uint16_t tick;
	uint8_t control;
}Timer_T;

void Timer_Setup(Timer_T* timer, uint16_t period, uint8_t cycle, uint8_t asyn, void(*cb)(void));

void Timer_Start(Timer_T* timer);

void Timer_Stop(Timer_T* timer);

void Timer_Restart(Timer_T* timer);

void Timer_Reset(Timer_T* timer, uint16_t period);

int Timer_IsActive(Timer_T* timer);

void Timer_Init(void);

void Timer_Register(Timer_T* timer);

void Timer_Unregister(Timer_T* timer);

void Timer_Service(void);


#endif


